﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QQ.Flyweight
{
    class Program
    {
        static void Main(string[] args)
        {
            var f = new fly();

            var v1 = f.GetValue(0);
            Console.WriteLine(v1);

            var v2 = f.GetValue(1);
            Console.WriteLine(v2);

            Console.ReadKey();
        }
    }

    class fly
    {
        private Dictionary<int, string> dic ;

        public fly()
        {
            dic = new Dictionary<int, string>()
            {
                {0,"一个记录"},
                {1,"又一个记录"}
            };
        }

        public string GetValue(int key)
        {
            return dic[key];
        }
    }
}
